package org.ysh.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.ysh.core.exceptions.UserNotAllowModifyException;
import org.ysh.vo.R;

@RestControllerAdvice
public class GlobalRestExceptionHandler {

    @ExceptionHandler(UserNotAllowModifyException.class)
    public R<?> handleUserNotAllowModifyException(UserNotAllowModifyException e){
        return R.fail(e.getMessage());
    }

}
